home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / include / glibtop / procsegment.h.z / procsegment.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  2.9 KB  |  93 lines

  1. /* $Id: procsegment.h,v 1.14 1999/02/23 11:43:09 martin Exp $ */
  2.  
  3. /* Copyright (C) 1998-99 Martin Baulig
  4.    This file is part of LibGTop 1.0.
  5.  
  6.    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
  7.  
  8.    LibGTop is free software; you can redistribute it and/or modify it
  9.    under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License,
  11.    or (at your option) any later version.
  12.  
  13.    LibGTop is distributed in the hope that it will be useful, but WITHOUT
  14.    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.    for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with LibGTop; see the file COPYING. If not, write to the
  20.    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.
  22. */
  23.  
  24. #ifndef __GLIBTOP_PROCSEGMENT_H__
  25. #define __GLIBTOP_PROCSEGMENT_H__
  26.  
  27. #include <glibtop.h>
  28. #include <glibtop/global.h>
  29.  
  30. BEGIN_LIBGTOP_DECLS
  31.  
  32. #define GLIBTOP_PROC_SEGMENT_TEXT_RSS        0
  33. #define GLIBTOP_PROC_SEGMENT_SHLIB_RSS        1
  34. #define GLIBTOP_PROC_SEGMENT_DATA_RSS        2
  35. #define GLIBTOP_PROC_SEGMENT_STACK_RSS        3
  36. #define GLIBTOP_PROC_SEGMENT_DIRTY_SIZE        4
  37. #define GLIBTOP_PROC_SEGMENT_START_CODE        5
  38. #define GLIBTOP_PROC_SEGMENT_END_CODE        6
  39. #define GLIBTOP_PROC_SEGMENT_START_STACK    7
  40.  
  41. #define GLIBTOP_MAX_PROC_SEGMENT        8
  42.  
  43. typedef struct _glibtop_proc_segment    glibtop_proc_segment;
  44.  
  45. /* Segment stuff */
  46.  
  47. struct _glibtop_proc_segment
  48. {
  49.     u_int64_t    flags,
  50.         text_rss,    /* text resident set size */
  51.         shlib_rss,    /* shared-lib resident set size */
  52.         data_rss,    /* data resident set size */
  53.         stack_rss,    /* stack resident set size */
  54.         dirty_size,    /* size of dirty pages */
  55.         start_code,
  56.                 /* address of beginning of code segment */
  57.         end_code,    /* address of end of code segment */
  58.         start_stack;    /* address of the bottom of stack segment */
  59. };
  60.  
  61. #define glibtop_get_proc_segment(p1, p2)    glibtop_get_proc_segment_l(glibtop_global_server, p1, p2)
  62.  
  63. #if GLIBTOP_SUID_PROC_SEGMENT
  64. #define glibtop_get_proc_segment_r    glibtop_get_proc_segment_p
  65. #else
  66. #define glibtop_get_proc_segment_r    glibtop_get_proc_segment_s
  67. #endif
  68.  
  69. void glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
  70.  
  71. #if GLIBTOP_SUID_PROC_SEGMENT
  72. void glibtop_init_proc_segment_p (glibtop *server);
  73. void glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
  74. #else
  75. void glibtop_init_proc_segment_s (glibtop *server);
  76. void glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
  77. #endif
  78.  
  79. #ifdef GLIBTOP_NAMES
  80.  
  81. /* You need to link with -lgtop_names to get this stuff here. */
  82.  
  83. extern const char *glibtop_names_proc_segment [];
  84. extern const unsigned glibtop_types_proc_segment [];
  85. extern const char *glibtop_labels_proc_segment [];
  86. extern const char *glibtop_descriptions_proc_segment [];
  87.  
  88. #endif
  89.  
  90. END_LIBGTOP_DECLS
  91.  
  92. #endif
  93.